package com.yoyo.itravel.web.controller;

import com.yoyo.itravel.bean.SightCompany;
import com.yoyo.itravel.dao.ISightCompanyDao;
import com.yoyo.itravel.exceptions.SightCompanyException;
import com.yoyo.itravel.service.ISightCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Description 景点公司操作控制层
 * 
 * @Author HZX
 * @Date 2020/6/27 22:47
 * @Version 1.0
 */
@Controller
@RequestMapping("/sight_company")
public class SightCompanyController {

    @Autowired
    private ISightCompanyService sightCompanyService;

    @RequestMapping("/findAll")
    @ResponseBody
    protected List<SightCompany> findAll() {
        try {
            return sightCompanyService.find(new SightCompany());
        } catch (SightCompanyException e) {
            e.printStackTrace();
        }
        return null;
    }
}
